package com.nbsaas.boot.agent.rest.resource;

import com.nbsaas.boot.agent.api.apis.AgentModelProviderApi;
import com.nbsaas.boot.entity.agent.AgentModelProvider;
import com.nbsaas.boot.agent.api.domain.request.AgentModelProviderRequest;
import com.nbsaas.boot.agent.api.domain.response.AgentModelProviderResponse;
import com.nbsaas.boot.agent.api.domain.simple.AgentModelProviderSimple;
import com.nbsaas.boot.agent.rest.convert.AgentModelProviderSimpleConvert;
import com.nbsaas.boot.agent.rest.convert.AgentModelProviderEntityConvert;
import com.nbsaas.boot.agent.rest.convert.AgentModelProviderResponseConvert;
import com.nbsaas.boot.agent.data.repository.AgentModelProviderRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class AgentModelProviderResource extends BaseResource<AgentModelProvider,AgentModelProviderResponse, AgentModelProviderSimple, AgentModelProviderRequest>  implements AgentModelProviderApi {

    @Resource
    private AgentModelProviderRepository agentModelProviderRepository;

    @Override
    public JpaRepositoryImplementation<AgentModelProvider, Serializable> getJpaRepository() {
        return agentModelProviderRepository;
    }

    @Override
    public Function<AgentModelProvider, AgentModelProviderSimple> getConvertSimple() {
        return new AgentModelProviderSimpleConvert();
    }

    @Override
    public Function<AgentModelProviderRequest, AgentModelProvider> getConvertForm() {
        return new AgentModelProviderEntityConvert();
    }

    @Override
    public Function<AgentModelProvider, AgentModelProviderResponse> getConvertResponse() {
        return new AgentModelProviderResponseConvert();
    }




}


